<template>
	<view class="box">
		<view  :class="['item', tapActive == index &&  isRotating ?  'rotating' : '', ]" @touchstart="touchstart(index)" @touchend="touchstart(index)" v-for="(item, index) in indexList" :key="index" @click="list(item)">
			<view class="icon">
				<u-icon :name="item.name" :label="item.title" size="24"></u-icon>
			</view>
			<view>
				<u-icon :name="item.icon" size="20"></u-icon>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isRotating: false,
				tapActive: 0,
				indexList: [{
					title:'租约即将到期',
					name:'calendar',
					icon:'arrow-right',
					id:0
				},
				{
					title:'服务费收取',
					name:'rmb-circle',
					icon:'arrow-right',
					id:1
				}]
			}
		},
		methods: {
			touchstart(index) {
				this.tapActive = index
				this.isRotating = !this.isRotating
			},
			list(item){
				uni.navigateTo({
					url:'./charge?id='+item.id,
					animationType: this.animation.type,
					animationDuration: this.animation.time
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "~@/styles/index.scss";
	@import "~@/styles/global.scss";
	.rotating {
		opacity: 0.5;
	}
	.box {
		background-color: $pagebgc;
		width: 100%;
		height: 100vh;
		.item{
			@include flexBetween;
			padding: 20rpx 30rpx;
			background-color: #fff;
			border-bottom: #e1e1e1 solid 1rpx;
		}
	}
</style>